package com.inspinia.base.api.service;

import com.inspinia.base.api.dao.InterfaceUserDataAuthorityDao;
import com.inspinia.base.api.model.InterfaceUserDataAuthority;
import com.inspinia.base.dao.BaseDao;
import com.inspinia.base.service.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
* 的服务层实现类
* Created by pujw on 2017-6-30.
*/
@Service
public class InterfaceUserDataAuthorityServiceImpl extends BaseServiceImpl<InterfaceUserDataAuthority> implements InterfaceUserDataAuthorityService {
    @Resource
    private InterfaceUserDataAuthorityDao interfaceUserDataAuthorityDao;

    @Override
    protected BaseDao<InterfaceUserDataAuthority> getDao() {
        return interfaceUserDataAuthorityDao;
    }
    
    @Transactional
    @Override
    public int batchDelete(Long[] ids){
    	return interfaceUserDataAuthorityDao.batchDelete(ids);
    }

    @Override
    public InterfaceUserDataAuthority findByUserId(Long userId) {
        return interfaceUserDataAuthorityDao.findByUserId(userId);
    }

    @Override
    public void deleteByUserId(Long userId) {
        interfaceUserDataAuthorityDao.deleteByUserId(userId);
    }

    @Override
    public InterfaceUserDataAuthority findByProvinceId(Long provinceId, Long userId) {
        return interfaceUserDataAuthorityDao.findByProvinceId(provinceId,userId);
    }

    @Override
    public InterfaceUserDataAuthority findByCityId(Long cityId, Long userId) {
        return interfaceUserDataAuthorityDao.findByCityId(cityId,userId);
    }

}
